#include "stacking.h"
#include "ui_stacking.h"
#include "mainWidget.h"

Stacking::Stacking(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Stacking)
{
    ui->setupUi(this);

    pWidget = static_cast<Widget*>(parent);

    ui->stackedWidget->setCurrentIndex(StackMgt_id);

    //返回手动子界面
    connect(ui->Btn_back, &QPushButton::clicked, this, [=](){
        pWidget->backManualPage();
    });

    connect(ui->Btn_stacking1, &QPushButton::clicked, this, [=](){
        pWidget->stackParaPage();
    });

    connect(ui->Btn_pageUp, &QPushButton::clicked, this, [=](){
        ui->stackedWidget_page->setCurrentIndex(0);
    });
    connect(ui->Btn_pageDown, &QPushButton::clicked, this, [=](){
        ui->stackedWidget_page->setCurrentIndex(1);
    });
    connect(ui->Btn_stackCopy, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(CopySel_id);
    });
    connect(ui->Btn_CtoU, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(CtoU_id);
    });
    connect(ui->Btn_UtoC, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(UtoC_id);
    });
    connect(ui->Btn_back2, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(StackMgt_id);
    });
    connect(ui->Btn_back3, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(CopySel_id);
    });
    connect(ui->Btn_back4, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(CopySel_id);
    });
    connect(ui->Btn_ok4, &QPushButton::clicked, this, [=](){
        ui->stackedWidget->setCurrentIndex(CopySel_id);
    });
}

Stacking::~Stacking()
{
    delete ui;
}
